import { RouteRecordRaw } from 'vue-router';
import { Layout } from '@/router/constant';
import { AppstoreFilled } from '@vicons/antd';
import { GlobalOutlined } from '@vicons/antd';
import { renderIcon } from '@/utils/index';

const routes: Array<RouteRecordRaw> = [
  {
    path: '/tools',
    name: 'Tools',
    redirect: '/tools/auto-login',
    component: Layout,
    meta: {
      title: '工具箱',
      icon: renderIcon(AppstoreFilled),
      sort: 10,
    },
    children: [
      {
        path: 'auto-login',
        name: 'auto-login',
        meta: {
          title: '自动登录',
        },
        component: () => import('@/views/tools/autoLogin.vue'),
      },
      {
        path: 'xml-to-mermaid',
        name: 'xml-to-mermaid',
        meta: {
          title: 'XML流程图生成',
        },
        component: () => import('@/views/tools/xmlToMermaid.vue'),
      },
      {
        path: 'cosmic',
        name: 'cosmic',
        meta: {
          title: 'COSMIC生成',
        },
        component: () => import('@/views/tools/components/CosmicNew.vue'),
      },
      {
        path: 'cosmic-overview-design',
        name: 'cosmic-overview-design',
        meta: {
          title: '概要设计生成',
        },
        component: () => import('@/views/tools/cosmicOverviewDesign.vue'),
      },
      {
        path: 'cosmic-new',
        name: 'cosmic-new',
        meta: {
          title: 'COSMIC新建',
          hidden: true,
        },
        component: () => import('@/views/tools/components/CosmicNew.vue'),
      },
      {
        path: 'cosmic-history',
        name: 'cosmic-history',
        meta: {
          title: 'COSMIC历史',
          hidden: true,
        },
        component: () => import('@/views/tools/components/CosmicHistory.vue'),
      },
      {
        path: 'ai-chat',
        name: 'ai-chat',
        meta: {
          title: 'AI聊天',
          hidden: true,
          icon: renderIcon(GlobalOutlined),
        },
        component: () => import('@/views/tools/aiChat.vue'),
      },
      {
        path: 'verify-cosmic',
        name: 'verify-cosmic',
        meta: {
          hidden: true,
          title: 'cosmic验证',
        },
        component: () => import('@/views/tools/verifyCosmic.vue'),
      },

    ],
  },
];

export default routes;
